from apicore.OrderRequest import orderRequest


class CartApi(orderRequest):
    def cart(self, token, body):
        uri = "/api/front/cart/save"
        data = body
        print(data)
        headers = {
            'Content-Type': 'application/json',
            'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
            'authori-zation': token
        }
        response = self.send_request('POST', uri, headers, data=data)
        self.logger.info(f"调用接口 {uri}，请求数据：{data}，请求头：{headers}")
        if response.status_code == 200:
            return response
        else:
            return None
